# coding=utf-8
# https://leetcode.cn/problems/first-bad-version/

# The isBadVersion API is already defined for you.
# @param version, an integer
# @return an integer
def isBadVersion(version):
    return False


class Solution:
    def firstBadVersion(self, n):
        """
        :type n: int
        :rtype: int
        """
        l = 0
        while l < n:
            m = (l + n) // 2
            if isBadVersion(m):
                n = m
            else:
                l = m + 1
        return l
